import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/cupertino.dart' hide Action;
import 'package:www.znpigai.teacher/utils/nav.dart';

import 'action.dart';
import 'state.dart';

Effect<HomeworkState> buildEffect() {
  return combineEffects(<Object, Effect<HomeworkState>>{
    HomeworkAction.action: _onAction,
    HomeworkAction.onClick: _onClick,
  });
}

void _onAction(Action action, Context<HomeworkState> ctx) {}

void _onClick(Action action, Context<HomeworkState> ctx) async {
  Navigator.of(ctx.context)
      .pushNamed(Nav.HOMEWORK_DETAIL, arguments: ctx.state);
}
